If your video output component uses any custom settings, your component must implement its own QTVideoOutputSaveState function to save them. If your video output component has no custom settings, it can use the default QTVideoOutputSaveState implementation provided by the base video output component. Listing 7 shows an implementation of the QTVideoOutputSaveState function that saves custom settings. The function creates a QT atom container for storing the settings.
Listing 7 Extending the QTVideoOutputSaveState function
pascal ComponentResult MyQTVideoOutputSaveState (Globals storage,
QTAtomContainer *settings)
{
OSErr err;
// call default implementation
err = QTVideoOutputSaveState (storage->baseVideoOutput, settings);
if (err) goto bail;
// add custom parameter(s)
err = QTInsertChild (*settings,kParentAtomIsContainer,
`FOOB', 1, 0,
sizeof (storage->customSetting),
&storage->customSetting, nil);
if (err) goto bail;
bail:
return err;
}
| Previous | Chapter Contents | Chapter Top | Next |